﻿using System;
using System.Collections.Generic;

namespace FBProjectTest.MockObjects.MSProject
{
    public class TasksMock : Microsoft.Office.Interop.MSProject.Tasks
    {
        private List<TaskMock> InternalTasks = new List<TaskMock>();

        public Microsoft.Office.Interop.MSProject.Task Add([System.Runtime.InteropServices.OptionalAttribute]object Name, [System.Runtime.InteropServices.OptionalAttribute]object Before)
        {
            var Task = new TaskMock(Count + 1, Name.ToString());
            InternalTasks.Add(Task);
            return Task;
        }

        public int Count
        {
            get { return InternalTasks.Count; }
        }

        public System.Collections.IEnumerator GetEnumerator()
        {
            return InternalTasks.GetEnumerator();
        }

        public Microsoft.Office.Interop.MSProject.Task this[object Index]
        {
            get { return InternalTasks[(int)Index - 1]; }
        }

        #region Not Implemented Microsoft.Office.Interop.MSProject.Tasks Members

        public Microsoft.Office.Interop.MSProject.Application Application
        {
            get { throw new NotImplementedException(); }
        }

        public Microsoft.Office.Interop.MSProject.Project Parent
        {
            get { throw new NotImplementedException(); }
        }

        public Microsoft.Office.Interop.MSProject.Task get_UniqueID(int Index)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
